#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int factorial(int n);

int main() {
    int N;
    int result;
    scanf("%d", &N);
    if (N < 0 || N > 12) {
        return 1;
    }
    result = factorial(N);
    printf("%d\n", result);
    return 0;
}

int factorial(int n) {
    if (n == 0) {
        return 1;
    }
    else {
        return n * factorial(n - 1);
    }
}